package andere_dingen;
public class Priemgetal {
  public Priemgetal(){
    int getalletje = 1;
    while(true){
      if (isPriem(getalletje)){
      System.out.println(getalletje);
      }
      getalletje++;
    }
  }

  public static boolean isPriem(int getal){
  int deler;
  for(deler=2; deler <= getal / 2; deler++){
    if (getal % deler == 0) {
      //is geen priemgetal
      return false;
    }
  }
  //is wel priemgetal
  return true;
  }

  public static void main(String[] args){
    new Priemgetal();
  }
}
